<?php /* Smarty version Smarty-3.1.18, created on 2019-03-25 16:00:00
         compiled from "/data/www/mystery/protected/views/benchmark/index.tpl" */ ?>
<?php /*%%SmartyHeaderCode:181161459554bf22f2deb169-15065887%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '5da768055385cad99f80085e149c9ddf9c44f1dd' => 
    array (
      0 => '/data/www/mystery/protected/views/benchmark/index.tpl',
      1 => 1553500794,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '181161459554bf22f2deb169-15065887',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.18',
  'unifunc' => 'content_54bf22f2e807c7_39394744',
  'variables' => 
  array (
    'tips' => 0,
    'level' => 0,
    'level_list' => 0,
    'key' => 0,
    'current_level' => 0,
    'val' => 0,
    'project_list' => 0,
    'project_question' => 0,
    'v' => 0,
    'question_id' => 0,
    'audit' => 0,
    'search_audit' => 0,
    'netquestion' => 0,
    'network_id' => 0,
    'question_list' => 0,
    'audit_show' => 0,
    'page' => 0,
    'level_auth' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_54bf22f2e807c7_39394744')) {function content_54bf22f2e807c7_39394744($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ('../common/head.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<script language="javascript">
<?php if ($_smarty_tpl->tpl_vars['tips']->value) {?>
var msg = '<?php echo $_smarty_tpl->tpl_vars['tips']->value;?>
';
//$(window).bind('beforeunload',function(e){
//    e = e || window.event;
///    if (e) {
//        e.returnValue = msg;
//    }
//    return  '以下网点问卷未提交，请提交后离开\n'+msg;
//});
<?php }?>

</script>
<!--header End-->
<div class="main w1060">
        <?php if ($_smarty_tpl->tpl_vars['level']->value!=4) {?>
            <div class="dbserch">
                    <form action="/benchmark/index" method="get">
                        <!--<select class="u185_input" name="level" autocomplete="off">
                            <option value="0">所有</option>
                            <?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['level_list']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['val']->key;
?>
                            <?php if ($_smarty_tpl->tpl_vars['key']->value!=5) {?>
                            <option value="<?php echo $_smarty_tpl->tpl_vars['key']->value;?>
" <?php if ($_smarty_tpl->tpl_vars['current_level']->value==$_smarty_tpl->tpl_vars['key']->value) {?>selected="selected"<?php }?>><?php echo $_smarty_tpl->tpl_vars['val']->value['desc'];?>
</option>
                            <?php }?>
                            <?php } ?>
                        </select>-->

                        <select id="u185_input" name="project_question_id" autocomplete='false'>
                            <option value='0'>请选择项目问卷</option>
                            <?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['project_list']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['val']->key;
?>
                            <option value="<?php echo $_smarty_tpl->tpl_vars['val']->value['project_id'];?>
" disabled="disabled" ><b><?php echo $_smarty_tpl->tpl_vars['val']->value['project_name'];?>
</b></option>
                            <?php if (isset($_smarty_tpl->tpl_vars['project_question']->value[$_smarty_tpl->tpl_vars['val']->value['project_id']])) {?>
                            <?php  $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['v']->_loop = false;
 $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['project_question']->value[$_smarty_tpl->tpl_vars['val']->value['project_id']]; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value) {
$_smarty_tpl->tpl_vars['v']->_loop = true;
 $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['v']->key;
?>
                            <option value="<?php echo $_smarty_tpl->tpl_vars['val']->value['project_id'];?>
-<?php echo $_smarty_tpl->tpl_vars['v']->value['question_id'];?>
" <?php if ($_smarty_tpl->tpl_vars['question_id']->value==$_smarty_tpl->tpl_vars['v']->value['question_id']) {?>selected="selected"<?php }?>>----<?php echo $_smarty_tpl->tpl_vars['v']->value['question_name'];?>
</option>
                            <?php } ?>
                            <?php }?>
                            <?php } ?>
                        </select>
                        <select name="audit" class="u185_input" autocomplete="off">
                            <option value="-1">审核状态</option>
                            <?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['audit']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['val']->key;
?>
                            <option value="<?php echo $_smarty_tpl->tpl_vars['key']->value;?>
" <?php if ($_smarty_tpl->tpl_vars['search_audit']->value==$_smarty_tpl->tpl_vars['key']->value) {?>selected="selected"<?php }?>><?php echo $_smarty_tpl->tpl_vars['val']->value;?>
</option>
                            <?php } ?>
                        </select>
                            <input name="" type="submit" value="确定"  class="anbut" />

                            <?php if ($_smarty_tpl->tpl_vars['level']->value==1) {?><a href="/benchmark/all" target="_blank">查看所有网点对标数据</a><?php }?>
                    </form>
            </div>
        <?php }?>
                <form name="form2" method="post" id="myForm1" action="/benchmark/setaudit">
		<div class="biaoge">   
			<table width="100%" border="0" cellspacing="0">
			  <tr>
                              <td class="btzong3"><input type="checkbox" id="che_box" value="checkbox"></td>
                              <td class="btzong3">序号</td>
                              <td class="btzong3"><strong>网点名称</strong></td>
                              <td class="btzong3"><strong>项目名称</strong></td>
                            <td class="btzong3"><strong>问卷名称</strong></td>
				<td class="btzong3"><strong>审核状态</strong></td>
                                <td class="btzong3"><strong>当前结点</strong></td>
				<td class="btzong3"><strong>得分</strong></td>
				<td class="btzong3"><strong>操作</strong></td>
			  </tr>
                          <?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['netquestion']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['val']->key;
?>
                          <?php if ($_smarty_tpl->tpl_vars['level']->value==4&&($_smarty_tpl->tpl_vars['network_id']->value==$_smarty_tpl->tpl_vars['val']->value['network_id'])) {?>
			  <tr>
                              <td>
                                  <?php if ($_smarty_tpl->tpl_vars['val']->value['audit']==0) {?>
                                  <input type="checkbox" name="nq_id[]" value="<?php echo $_smarty_tpl->tpl_vars['val']->value['nq_id'];?>
" class="subcheck" <?php if ($_smarty_tpl->tpl_vars['val']->value['status']==2) {?>disabled="disabled"<?php }?>>
                                  <?php }?>
                              </td>
                              <td><?php echo $_smarty_tpl->tpl_vars['val']->value['network_id'];?>
</td>
                              <td><?php echo $_smarty_tpl->tpl_vars['val']->value['network_name'];?>
</td>
                              <td><?php echo $_smarty_tpl->tpl_vars['project_list']->value[$_smarty_tpl->tpl_vars['val']->value['project_id']]['project_name'];?>
</td>
				 <td><?php echo $_smarty_tpl->tpl_vars['question_list']->value[$_smarty_tpl->tpl_vars['val']->value['question_id']]['question_name'];?>
</td>
				<td>
                                    <?php if ($_smarty_tpl->tpl_vars['audit_show']->value[$_smarty_tpl->tpl_vars['val']->value['audit']]) {?>
                                    <a href="javascript:;" onclick="detail(<?php echo $_smarty_tpl->tpl_vars['val']->value['nq_id'];?>
);" title="点击查看详细审核记录">
                                        <?php echo $_smarty_tpl->tpl_vars['audit_show']->value[$_smarty_tpl->tpl_vars['val']->value['audit']];?>

                                    </a>
                                    <?php }?>
                                </td>
                                <td><?php if (isset($_smarty_tpl->tpl_vars['level_list']->value[$_smarty_tpl->tpl_vars['val']->value['node_id']])) {?><?php echo $_smarty_tpl->tpl_vars['level_list']->value[$_smarty_tpl->tpl_vars['val']->value['node_id']]['desc'];?>
<?php } else { ?>网点<?php }?></td>
				<td><?php if ($_smarty_tpl->tpl_vars['question_list']->value[$_smarty_tpl->tpl_vars['val']->value['question_id']]['show_score']) {?><?php echo cut_number($_smarty_tpl->tpl_vars['val']->value['score']);?>
<?php } else { ?>
                                    -.-
                                    <?php }?></td>
                                <td>
                                    <a href="javascript:;" onclick="window.open('/benchmark/view?nq_id=<?php echo $_smarty_tpl->tpl_vars['val']->value['nq_id'];?>
')"><?php if ($_smarty_tpl->tpl_vars['val']->value['op_node_id']!=0) {?>浏览问卷<?php } else { ?>审核问卷<?php }?></a> 
			  </tr>
                          <?php }?>
                          <?php if ($_smarty_tpl->tpl_vars['level']->value!=4) {?>
                          <tr id="show_complete_<?php echo $_smarty_tpl->tpl_vars['val']->value['nq_id'];?>
">
                              <td>
                                  <input type="checkbox" name="nq_id[]" value="<?php echo $_smarty_tpl->tpl_vars['val']->value['nq_id'];?>
" class="subcheck" <?php if ($_smarty_tpl->tpl_vars['val']->value['status']==2) {?>disabled="disabled"<?php }?>>
                              </td>
                              <td><?php echo $_smarty_tpl->tpl_vars['val']->value['network_id'];?>
</td>
                              <td><?php echo $_smarty_tpl->tpl_vars['val']->value['network_name'];?>
</td>
                              <td><?php echo $_smarty_tpl->tpl_vars['project_list']->value[$_smarty_tpl->tpl_vars['val']->value['project_id']]['project_name'];?>
</td>
				<td><?php echo $_smarty_tpl->tpl_vars['question_list']->value[$_smarty_tpl->tpl_vars['val']->value['question_id']]['question_name'];?>
</td>
				<td>
                                    <?php if ($_smarty_tpl->tpl_vars['level_list']->value[$_smarty_tpl->tpl_vars['val']->value['op_node_id']]) {?><?php echo $_smarty_tpl->tpl_vars['level_list']->value[$_smarty_tpl->tpl_vars['val']->value['op_node_id']]['desc'];?>
<?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['audit_show']->value[$_smarty_tpl->tpl_vars['val']->value['audit']]) {?>
                                    <a href="javascript:;" onclick="detail(<?php echo $_smarty_tpl->tpl_vars['val']->value['nq_id'];?>
);" title="点击查看详细审核记录"><?php echo $_smarty_tpl->tpl_vars['audit_show']->value[$_smarty_tpl->tpl_vars['val']->value['audit']];?>
</a>
                                    <?php }?>
                                </td>
                                <td><?php if (isset($_smarty_tpl->tpl_vars['level_list']->value[$_smarty_tpl->tpl_vars['val']->value['node_id']])) {?><?php echo $_smarty_tpl->tpl_vars['level_list']->value[$_smarty_tpl->tpl_vars['val']->value['node_id']]['desc'];?>
<?php } else { ?>网点<?php }?></td>
				<td><?php if ($_smarty_tpl->tpl_vars['question_list']->value[$_smarty_tpl->tpl_vars['val']->value['question_id']]['show_score']) {?><?php echo cut_number($_smarty_tpl->tpl_vars['val']->value['score']);?>
<?php } else { ?>
                                    -.-
                                    <?php }?></td>
                                <td><a href="javascript:;" onclick="window.open('/benchmark/view?nq_id=<?php echo $_smarty_tpl->tpl_vars['val']->value['nq_id'];?>
')">浏览问卷</a><!-- <?php if ($_smarty_tpl->tpl_vars['level']->value<4&&$_smarty_tpl->tpl_vars['val']->value['status']!=2) {?><span id='show_complete_<?php echo $_smarty_tpl->tpl_vars['val']->value['nq_id'];?>
'> | <a href="javascript:;" onclick="complete(<?php echo $_smarty_tpl->tpl_vars['val']->value['nq_id'];?>
);">完成</a></span><?php }?>--></td>
			  </tr>
                          <?php }?>
                          <?php } ?>
			  
		  </table>
		</div>
		<div id="pages">
			<?php echo $_smarty_tpl->tpl_vars['page']->value;?>

		</div>
		<div class="fudong">
                    <?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['level_auth']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['val']->key;
?>
                    <?php if ($_smarty_tpl->tpl_vars['level']->value==4) {?>
                    <input type="hidden" name="audit" value="<?php echo $_smarty_tpl->tpl_vars['val']->value;?>
" /><br/>
                    <?php } else { ?>
                    <input type="radio" name='audit' value='<?php echo $_smarty_tpl->tpl_vars['val']->value;?>
'><?php echo $_smarty_tpl->tpl_vars['audit']->value[$_smarty_tpl->tpl_vars['val']->value];?>
<br/>
                    <?php }?>
                    <?php } ?>
                    <input type="submit" value="提交" class="button"/>
		</div>
                </form>
</div>
<script type="text/javascript">
$(function(){
        var options = {         
        beforeSubmit:  showRequest,  
        success:       showResponse,
        dataType:  'json'
    }
    $('#myForm1').ajaxForm(options); 
    
    //判断subcheck的长度，如果没有的话，直接把提交按钮隐藏
    if ($('.subcheck').length==0){
        $('.fudong').remove();
    }
})
function showRequest(formData, jqForm, options) { 
    return true;
}
function showResponse(responseText, statusText, xhr, $form)  { 
    alert(responseText.note);
    window.location.reload();
}
 
//复选框事件  
//全选、取消全选的事件  
$(document).on("click","#che_box",function(){
    var ischecked= $("#che_box:checked").length;
 
    var $checkboxs =$("input[name='nq_id[]']");
    if(ischecked){
        $checkboxs.prop("checked",true);
    }else{
        $checkboxs.prop("checked",false);
    }
});

//设置问卷完成状态
function complete(nq_id){
    if (confirm('确认提交完成此问卷?')) {
        $.getJSON('/benchmark/SetStatus',{nq_id:nq_id,status:2},function(res){
            alert(res.note);
            if (res.status==1) {
                $('#show_complete_'+nq_id).remove();
            }
        });
    }

}
//详细审核历史记录
function detail(nq_id){
    $.layer({
        type: 2, 
        title: '网点审核历史记录',
        border:[10, 0.3, '#000'],
        closeBtn:[0, true],
        shade: [0.5, '#000'],
        offset: ['100px', ''],
        area: ['500px', '450px'],
        iframe: {src: '/benchmark/AuditHistory?nq_id='+nq_id}
    });
}
</script>
<!--main End-->
<?php echo $_smarty_tpl->getSubTemplate ("../common/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<?php }} ?>
